
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
option = Options()
option.add_experimental_option('excludeSwitches', ['enable-automation'])
option.add_argument("--disable-blink-features=AutomationControlled")
#实现不关闭的重点

option.add_experimental_option("detach", True)
#关闭密码弹框：
option.add_experimental_option("prefs", {
                "download.prompt_for_download": False,
                "download.directory_upgrade": True,
                "safebrowsing.enabled": True,
                "credentials_enable_service": False,
                "profile.password_manager_enabled": False
            })
option.add_experimental_option("excludeSwitches", ['enable-automation'])



driver=webdriver.Chrome(options=option)
driver.get("http://www.baidu.com")